package com.tengju.bff.interfaces.covercharge.constant;

/**
 * 申请证书枚举
 * */
public enum CertificateApplyEnum {
    //与证书相关
    LEGAL_PERSON_IDENTITY_IS_ERROR("legalPersonIdentity is not a valid ID number", "身份证号码不正确"),
    NO_IDENTITY("no identity", "缺少证件号码"),
    NO_NAME("no name", "缺少名称"),
    IDENTITY_ERROR("identity is not a valid ID number", "身份证号码不正确"),
    NO_LEGAL_PERSON("no legalPerson", "未填写经办人或法定代表人"),
    NO_LEGAL_PERSON_IDENTITY("no legalPersonIdentity", "未填写经办人或法定代表人证件号码"),
    BAD_CREDENTIAL("bad credential format", "credential实名信息参数不正确"),

    //手机三要素相关
    V_CODE_IS_WRONG("vcode is wrong","验证码错误"),
    NO_PERSONAL_IDENTITY_3KEY("no personalIdentity3Key","没有验证码key"),
    MOBILE_ERROR("mobile is not a valid phone number","手机号码错误"),
    ;


    private CertificateApplyEnum(String code, String desc){
        this.code=code;
        this.desc=desc;
    }

    private String code;
    private String desc;


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDescription() {
        return desc;
    }

    public void setDescription(String desc) {
        this.desc = desc;
    }

    public String getDesc() {
        return this.desc;
    }

    public String toString(){ return this.code; }

    public static CertificateApplyEnum getStatusDesc (String code){
        for(CertificateApplyEnum thisEnum : (CertificateApplyEnum.values())){
            if(thisEnum.getCode().equals(code)){//如果传入的code与此枚举code相同，则返回此枚举
                return thisEnum;
            }
        }
        return null;
    }
}
